<template>
    <elm-page-tb>
        <template #top>
            <el-date-picker v-model="postData.this_month" type="month" value-format="yyyy-MM" placeholder="选择年月" size="mini" style="width: 250px;" clearable></el-date-picker>
            <right>
                <el-button-group>
                    <el-button icon="el-icon-search" size="mini" @click="tablebinding()">查询</el-button>
                    <elm-open-button url="month_tab_edit" icon="el-icon-edit" title="新增" width="900" height="60%">新增
                    </elm-open-button>
                </el-button-group>
            </right>
        </template>
        <elm-table url="/business/bms/month/tab/GetData" :post-data="postData" :show-index="true" height="100%">
            <el-table-column prop="this_month" label="年月" align="left" header-align="center">
            </el-table-column>
            <el-table-column prop="total_income" label="总收入(万元)" align="center">
            </el-table-column>
            <el-table-column prop="net_profit" label="净利润(万元)" align="center">
            </el-table-column>
            <el-table-column prop="gross_profit" label="毛利(万元)" align="center">
            </el-table-column>
            <el-table-column prop="bus_cost" label="营业成本(万元)" align="center">
            </el-table-column>
            <el-table-column prop="sell_cost" label="销售费用(万元)" align="center">
            </el-table-column>
            <el-table-column prop="manage_cost" label="管理费用(万元)" align="center">
            </el-table-column>
            <el-table-column prop="finance_cost" label="财务费用(万元)" align="center">
            </el-table-column>
            <el-table-column fixed="right" label="操作" width="120px" align="center" style="position:absolute">
                <template v-slot="scope">
                    <elm-open-button url="month_tab_edit" title="编辑" width="900" height="60%" :data="{ model: scope.row }"
                                     type="text">编辑
                    </elm-open-button>
                    <el-button type="text" size="mini" @click="deleteData(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </elm-table>
    </elm-page-tb>
</template>

<script>
export default {
    extends: elmVueBase,
    data() {
        return {
            postData: {this_month: null}
        }
    },
    async created() {
    },
    methods: {
        async deleteData(data) {
            await this.delete('/business/bms/month/tab/Delete', {id: data.id});
            this.tablebinding();
        }
    }
}
</script>

<style scoped>
</style>